
#任务页面类

from selenium.webdriver.common.by import By
from page.base_page import BasePage
from page.index_page import IndexPage

class TaskPage(BasePage):
    url = "/crm/index.php?m=task"

#主页任务定位器

    newtask_locator = (By.LINK_TEXT, '新建任务')  # 新建任务


# 获取当前页面地址
    def get_current_url(self):
        return self.driver.current_url


#点击新建任务
    def click_newtask(self):
        self.driver.find_element(*self.newtask_locator).click()



    #断言  获取表格内容
    def renwubiaoge(self,table_loc,row,cell):
        cell = str(cell)
        row = str(row)
        locator = table_loc[1]+'/tbody/tr['+row+']/td['+ cell +']'+'/a'
        text = self.driver.find_element(By.XPATH,locator).text
        return text